A traditional compiler takes source code in a high-level programming language, such as C, C++, COBOL, PL/I, or some other equivalent high level semantic representation of the source code as input. The traditional compiler compiles or converts the high-level source code into machine language code, i.e., binary code in ones and zeros that is executable on a machine (data processing system).
In contrast, ‘binary optimization’ or ‘binary translation’ is a compilation process that takes machine code in binary language as input and recompiles the machine code to a different machine code that is suitable for execution on the same or a different machine architecture. A binary optimization tool performs this binary optimization process.
Binary optimization is needed and used particularly in those cases where the binary code is machine-dependent or machine-architecture specific. For example, a twenty year old machine may have employed an instruction set for which an initial binary code may have been created. When that old machine has to be replaced by a new machine, the instruction set of the new machine may differ from the instruction set of the old machine. Accordingly, even if the new instruction set is backward compatible, the initial binary code may not execute efficiently on the new machine because the initial binary code fails to take advantage of the optimizations and efficiencies of the new architecture of the new machine, which can be exploited by the new instruction set.
In some cases, the source code from which the initial binary code was created is lost, or otherwise unavailable. Another common reason, especially in the case of COBOL, is that the appropriate skills and knowledge to modify or recompile the source code for performance improvement are not easily available. Thus, recompiling the same source code with a new complier that uses the new instruction set to produce a new binary code for the new machine is not always possible or even desirable. In these and many other circumstances, the initial binary code has to be translated, or optimized, for use on a different machine architecture, such as to use the new instruction set for a given target machine architecture. This binary-to-binary translation is interchangeably referred to hereinafter as ‘binary optimization’ or ‘binary translation’.